<template>
  <div class="container">
    <h1 class="clickactive" @click="ss">{{ msg }}</h1>
    <span class="text_cut"></span>
    <el-button @click="semit" type="primary">按钮</el-button>
  </div>
</template>
<script>
import emitter from "@/utils/event-bus";
export default {
  name: "",
  components: {},
  // 定义属性
  data() {
    return {
      msg: "hello world",
    };
  },
  computed: {},
  watch: {},
  methods: {
    demos(flag) {
      console.log("测司机", flag);
    },
    ss() {
      emitter.emit("test", "hello wordl");
    },
    semit(){
      emitter.emit("showtext", "zheshi");
    }
  },
  created() {
    console.log(this.$store.state.name);
    console.log(this.$route.query.name);
    emitter.on("test", (flg) => {
      this.demos(flg);
    });
  },
  mounted() {},
};
</script>

<style  lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  h1 {
    color: #000;
    font-size: 20px;
  }
}
</style>